package org.zxw.cms.dao;

import java.util.List;

import org.zxw.basic.dao.IBaseDao;
import org.zxw.basic.model.Pager;
import org.zxw.cms.model.Group;
import org.zxw.cms.model.Role;
import org.zxw.cms.model.RoleType;
import org.zxw.cms.model.User;
import org.zxw.cms.model.UserGroup;
import org.zxw.cms.model.UserRole;

public interface IUserDao extends IBaseDao<User> {
	public List<Role> listUserRoles(int userId);

	public List<Group> listUserGroups(int userId);

	public List<Integer> listUserRoleIds(int userId);

	public List<Integer> listUserGroupIds(int userId);

	public UserRole loadUserRole(int userId, int roleId);

	public UserGroup loadUserGroup(int userId, int groupId);

	public User loadByUsername(String username);

	public List<User> listRoleUsers(int roleId);

	public List<User> listGroupUsers(int groupId);

	public List<User> listRoleUsers(RoleType roleType);

	public void addUserRole(User user, Role role);

	public void addUserGroup(User user, Group group);

	public void deleteUserRole(int userId, int roleId);

	public void deleteUserGroup(int userId, int groupId);

	public Pager<User> findUser();

	public void deleteUserRoles(int userId);

	public void deleteUserGroups(int userId);

}
